<?php echo $header; ?>
<div id="content">
  <div class="breadcrumb">
    <?php echo $this->breadCrumbs(); ?>
  </div>
  <?php if (isset($error_warning)) { ?>
  <div class="warning"><?php echo $error_warning; ?></div>
  <?php } ?>
  <?php if ($success) { ?>
  <div class="success"><?php echo $success; ?></div>
  <?php } ?>
  <div class="box">
    <div class="heading">
      <h1><img src="view/image/user.png" alt="" /> <?php echo $_['heading_title']; ?></h1>
      <div class="buttons">
	  <a href="<?php echo  UA('user/user_log/clear'); ?>" class="button"><?php echo $_['button_clear']; ?></a>
	  </div>
    </div>
    <div class="content">
      <form action="" method="post" enctype="multipart/form-data" id="form">
        <table class="list">
          <thead>
            <tr>
             <td class="left">
                <a <?php echo sort_url('username'); ?>><?php echo $_['column_username']; ?></a>
               </td>
              <td class="left">
                <a <?php echo sort_url('ip'); ?>><?php echo $_['column_ip']; ?></a>
               </td>
              <td class="left">
                <a <?php echo sort_url('date_added'); ?>><?php echo $_['column_date_added']; ?></a>
               </td>
              <td><?php echo $_['column_info']; ?></td>
            </tr>
          </thead>
          <tbody>
          	 <tr class="filter">
              <td><input type="text" name="filter_username" value="<?php echo $filter_username; ?>"  size="15" /></td>
              <td><input type="text" name="filter_ip" value="<?php echo $filter_ip; ?>" size="12"/></td>
              <td><input type="text" class="date" name="filter_date_added" value="<?php echo $filter_date_added; ?>" size="12"/></td>
              <td align="right"><a onclick="filter();" class="button"><?php echo $_['button_filter']; ?></a></td>
            </tr>
            <?php if ($logs) { ?>
            <?php foreach ($logs as $log) { ?>
            <tr onmouseover="this.className='on';" onmouseout="this.className='';">
              <td class="left"><?php echo $log['username'];?></td>
              <td class="left"><?php echo $log['ip']; ?></td>
              <td class="left"><?php echo $log['date_added']; ?></td>
              <td class="left"><?php echo $log['info']; ?></td>
            </tr>
            <?php } ?>
            <?php } else { ?>
            <tr>
              <td class="center" colspan="6"><?php echo $_['text_no_results']; ?></td>
            </tr>
            <?php } ?>
          </tbody>
        </table>
      </form>
      <div class="pagination"><?php echo $pagination; ?></div>
      <div class="blue mgt10"><?php echo $_['clear_log_note']; ?></div>
    </div>
  </div>
</div>
<script>
function filter() {
	url = '<?php echo UA('user/user_log', 'filter_reset=1'); ?>';

	var v = $('input[name=\'filter_username\']').attr('value');
	if (v) {
		url += '&filter_username=' + encodeURIComponent(v);
	}

	v = $('input[name=\'filter_ip\']').attr('value');
	if (v) {
		url += '&filter_ip=' + encodeURIComponent(v);
	}

	v = $('input[name=\'filter_date_added\']').attr('value');
	if (v != '') {
		url += '&filter_date_added=' + encodeURIComponent(v);
	}
	location = url;
}

$('.date').datepicker({dateFormat: 'yy-mm-dd'});
</script>
<?php echo $footer; ?> 